import request from '@/request/request'

// 获取收款单列表
export function getReceiptList(params) {
  return request({
    url: '/finance/advanceReceiptBill/list',
    method: 'get',
    params
  })
}

// 获取收款单详情
export function getReceiptDetail(id) {
  return request({
    url: `/finance/advanceReceiptBill/detail/${id}`,
    method: 'get'
  })
}

// 新增收款单
export function addReceipt(data) {
  return request({
    url: '/finance/advanceReceiptBill/add',
    method: 'post',
    data
  })
}

// 修改收款单
export function updateReceipt(data) {
  return request({
    url: '/finance/advanceReceiptBill/update',
    method: 'put',
    data
  })
}

// 删除收款单
export function deleteReceipt(id) {
  return request({
    url: `/finance/advanceReceiptBill/delete/${id}`,
    method: 'delete'
  })
}

// 批量删除收款单
export function batchDeleteReceipt(ids) {
  return request({
    url: '/finance/advanceReceiptBill/batchDelete',
    method: 'delete',
    data: ids
  })
}

// 审核收款单
export function approveReceipt(id) {
  return request({
    url: `/finance/advanceReceiptBill/approve/${id}`,
    method: 'put'
  })
}

// 批量审核收款单
export function batchApproveReceipt(ids) {
  return request({
    url: '/finance/advanceReceiptBill/batchApprove',
    method: 'put',
    data: ids
  })
}

// 导出收款单
export function exportReceipt(params) {
  return request({
    url: '/finance/advanceReceiptBill/export',
    method: 'get',
    params,
    responseType: 'blob'
  })
}

// 获取收款单统计
export function getReceiptStats(params) {
  return request({
    url: '/finance/advanceReceiptBill/stats',
    method: 'get',
    params
  })
} 